`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    17:24:29 04/01/2014 
// Design Name: 
// Module Name:    Display 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module Display(
    /*output reg [2:0] red,
    output reg [2:0] green,
    output reg [1:0] blue,*/
	 output [2:0] red,
    output [2:0] green,
    output [1:0] blue,
    input [10:0] Hcounter,
    input [10:0] Vcounter,
    input blank,
    input CLK,
    input [15:0] Data
    );
	 reg sign;
	 
	 parameter v1 =150;
	 parameter v2 =170;
	 parameter v3 =190;
	 parameter v4 =210;
	 parameter v5 =230;
	 parameter v6 =250;
	 
	 parameter h11 =110;
	 parameter h12 =130;
	 parameter h13 =170;
	 parameter h14 =190;
	 
	 parameter h21 =210;
	 parameter h22 =230;
	 parameter h23 =270;
	 parameter h24 =290;
	 
	 parameter h31 =310;
	 parameter h32 =330;
	 parameter h33 =370;
	 parameter h34 =390;
	 
	 parameter h41 =410;
	 parameter h42 =430;
	 parameter h43 =470;
	 parameter h44 =490;
	 

	 
/*always @(posedge CLK)
	begin
		green = 3'd0;
		blue = 2'd0;
	end*/
assign green = 3'd0;
assign blue = 2'd0;
assign red = (blank) ? 3'b000 : 
             ((Data[3:0]==4'h0) && ((((Hcounter>h41&&Hcounter<h42) || (Hcounter>h43&&Hcounter<h44))&& (Vcounter >v1&&Vcounter<v6))
					||((Hcounter>h41&&Hcounter<h44)&&((Vcounter>v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'h1) && ((Hcounter>h43&&Hcounter<h44)&& (Vcounter>v1&&Vcounter<v6)))	?3'b111:
				 ((Data[3:0]==4'h2) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'h3) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'h4) && (((Hcounter>h41&&Hcounter<h44)&&(Vcounter>v3&&Vcounter<v4)) 
					||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6)))  ) ? 3'b111:
				 ((Data[3:0]==4'h5) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[3:0]==4'h6) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'h7) && ((((Hcounter>h43&&Hcounter<h44)&& (Vcounter>v1&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v2)))) ) ? 3'b111:
				 ((Data[3:0]==4'h8) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'h9) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[3:0]==4'hA) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'hB) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'hC) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'hD) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h43&&Hcounter<h44)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'hE) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[3:0]==4'hF) && ((((Hcounter>h41&&Hcounter<h44)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h41&&Hcounter<h42)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111: 
					///////////////////////
				 ((Data[7:4]==4'h0) && ((((Hcounter>h31&&Hcounter<h32) || (Hcounter>h33&&Hcounter<h34))&& (Vcounter >v1&&Vcounter<v6))
					||((Hcounter>h31&&Hcounter<h34)&&((Vcounter>v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'h1) && ((Hcounter>h33&&Hcounter<h34)&& (Vcounter>v1&&Vcounter<v6)))	?3'b111:
				 ((Data[7:4]==4'h2) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'h3) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'h4) && (((Hcounter>h31&&Hcounter<h34)&&(Vcounter>v3&&Vcounter<v4)) 
					||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6)))  ) ? 3'b111:
				 ((Data[7:4]==4'h5) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[7:4]==4'h6) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'h7) && ((((Hcounter>h33&&Hcounter<h34)&& (Vcounter>v1&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v2)))) ) ? 3'b111:
				 ((Data[7:4]==4'h8) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'h9) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[7:4]==4'hA) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'hB) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'hC) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'hD) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h33&&Hcounter<h34)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'hE) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[7:4]==4'hF) && ((((Hcounter>h31&&Hcounter<h34)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h31&&Hcounter<h32)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ///////////////
				 ((Data[11:8]==4'h0) && ((((Hcounter>h21&&Hcounter<h22) || (Hcounter>h23&&Hcounter<h24))&& (Vcounter >v1&&Vcounter<v6))
					||((Hcounter>h21&&Hcounter<h24)&&((Vcounter>v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'h1) && ((Hcounter>h23&&Hcounter<h24)&& (Vcounter>v1&&Vcounter<v6)))	?3'b111:
				 ((Data[11:8]==4'h2) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'h3) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'h4) && (((Hcounter>h21&&Hcounter<h24)&&(Vcounter>v3&&Vcounter<v4)) 
					||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6)))  ) ? 3'b111:
				 ((Data[11:8]==4'h5) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[11:8]==4'h6) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'h7) && ((((Hcounter>h23&&Hcounter<h24)&& (Vcounter>v1&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v2)))) ) ? 3'b111:
				 ((Data[11:8]==4'h8) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'h9) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[11:8]==4'hA) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'hB) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'hC) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'hD) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h23&&Hcounter<h24)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'hE) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[11:8]==4'hF) && ((((Hcounter>h21&&Hcounter<h24)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h21&&Hcounter<h22)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ////////////////////
				 ((Data[15:12]==4'h0) && ((((Hcounter>h11&&Hcounter<h12) || (Hcounter>h13&&Hcounter<h14))&& (Vcounter >v1&&Vcounter<v6))
					||((Hcounter>h11&&Hcounter<h14)&&((Vcounter>v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'h1) && ((Hcounter>h13&&Hcounter<h14)&& (Vcounter>v1&&Vcounter<v6)))	?3'b111:
				 ((Data[15:12]==4'h2) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'h3) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'h4) && (((Hcounter>h11&&Hcounter<h14)&&(Vcounter>v3&&Vcounter<v4)) 
					||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v4))||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6)))  ) ? 3'b111:
				 ((Data[15:12]==4'h5) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[15:12]==4'h6) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'h7) && ((((Hcounter>h13&&Hcounter<h14)&& (Vcounter>v1&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v2)))) ) ? 3'b111:
				 ((Data[15:12]==4'h8) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'h9) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v4)))) ) ? 3'b111:
				 ((Data[15:12]==4'hA) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'hB) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v3&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'hC) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'hD) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h13&&Hcounter<h14)&&(Vcounter>v1&&Vcounter<v6))||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v3&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'hE) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4)||(Vcounter>v5&&Vcounter<v6))) 
					||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				 ((Data[15:12]==4'hF) && ((((Hcounter>h11&&Hcounter<h14)&& ((Vcounter >v1&&Vcounter<v2)||(Vcounter>v3&&Vcounter<v4))) 
					||((Hcounter>h11&&Hcounter<h12)&&(Vcounter>v1&&Vcounter<v6)))) ) ? 3'b111:
				3'b000;

				 endmodule
